package com.slz3.business.module.configManagement.conCircle.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conCircle.domain.ConCircle;
import com.slz3.business.module.configManagement.conCircle.domain.ConCircleCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class ConCircleResController {

    static Mono<ServerResponse> add(ServerRequest req, ConCircle conCircle) {
        if (ConCircleResUnsafeValid.add(req, conCircle)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.add_$ConCircleUpdateLock(req, conCircle);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, ConCircleCondition conCircleCondition) {
        if (ConCircleResUnsafeValid.delete(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.delete_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, ConCircle conCircle) {
        if (ConCircleResUnsafeValid.modify(req, conCircle)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.modify_$ConCircleUpdateLock(req, conCircle);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (ConCircleResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (ConCircleResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.info_$ConCircleUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (ConCircleResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, ConCircleCondition conCircleCondition) {
        //
        if (ConCircleResUnsafeValid.auditSubmit(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.auditSubmit_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, ConCircleCondition conCircleCondition) {
        if (ConCircleResUnsafeValid.audit(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.audit_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, ConCircleCondition conCircleCondition) {
        if (ConCircleResUnsafeValid.auditReject(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.auditReject_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, ConCircleCondition conCircleCondition) {
        if (ConCircleResUnsafeValid.usingEnable(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.usingEnable_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, ConCircleCondition conCircleCondition) {
        if (ConCircleResUnsafeValid.usingDisable(req, conCircleCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return ConCircleResAtomic.usingDisable_$ConCircleUpdateLock(req, conCircleCondition);
        }
    }

}
